<%@ tag body-content="scriptless" trimDirectiveWhitespaces="true" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib prefix="util" uri="http://www.gettestfire.org/taglibs/util" %>

<%@ attribute name="item" required="true" type="org.testfire.realm.model.entities.testfire.TestsetEntity" %>
<%@ attribute name="outputHeader" required="false" type="java.lang.Boolean" %>
<%@ attribute name="outputFooter" required="false" type="java.lang.Boolean" %>
<%@ attribute name="asJSON" required="false" type="java.lang.Boolean" %>
<c:set var="header" value="${empty outputHeader ? false : outputHeader}"/>
<c:set var="footer" value="${empty outputFooter ? false : outputFooter}"/>
<c:set var="asJSON" value="${empty asJSON ? false : asJSON}"/>

<c:choose>
	<c:when test="${asJSON}">{id: ${item.id}, name: "${item.name}", created: "${util:toJSDateTime(item.created)}", lastverified: "${util:toJSDateTime(item.lastverified)}",
			forbug: "${item.forbug}", description: "${item.description}", username: "${item.username}"}</c:when>
	<c:otherwise>
		<c:if test="${outputHeader}">
			<table >
			<thead>
				<tr>
					<td><input id="all" type="checkbox" name="tfTestSetList"/></td>
					<td>Name</td>
					<td>Id</td>
					<td>Created</td>
					<td>Description</td>
				</tr>
			</thead>
		</c:if>
		<c:if test="${!outputHeader && !outputFooter}">
			<tr>
				<td><input type="checkbox" name="tfTestSetList"/></td>
				<td>${item.name}</td>
				<td>${item.id}</td>
				<td>${item.created}</td>
				<td>${item.description}</td>
			</tr>
		</c:if>
		<c:if test="${outputFooter}">
			</table >
		</c:if>

	</c:otherwise>

</c:choose>
